home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14273 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: nntp-server.caltech.edu!ansok
  2. From: ansok@alumnae.caltech.edu (Gary E. Ansok)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Leap year
  5. Date: 29 Mar 1996 18:46:20 GMT
  6. Organization: Caltech Alumni Association
  7. Message-ID: <4jhb5s$4mr@gap.cco.caltech.edu>
  8. References: <3135A7F2.2120@hiwaay.net> <4ilcd9$3q0@clarknet.clark.net> <31596B2F.5219@mail.tju.edu> <4jegf6$7d2@news.hal.com>
  9. NNTP-Posting-Host: alumnae.caltech.edu
  10.  
  11. In article <4jegf6$7d2@news.hal.com>, Spike White <spike@hal.com> wrote:
  12. >No, because 1800, 1900 and 2100 are not leap years.  The rule is:
  13. >"every 4 yrs, except for every 100 yrs, except for every 400 yrs".  In
  14. >C, that's
  15. >
  16. >    return (!(y % 4) && ((y % 100) || !(y % 400)));
  17. >
  18. >and that doesn't even account for the Gregorian calendar (used before 
  19. >1752).
  20.  
  21. If you're talking about past centenary years, the answer is 
  22. "it depends."
  23.  
  24. If you meet an old guy who claims he was born on Feb. 29, 1900,
  25. is he necessarily lying?  (Hint:  What if he was born in Russia?)
  26.  
  27. Genealogy software has a lot of fun keeping track of different
  28. leap year rules, different start-of-year rules, different times
  29. to switch between one calendar and another, etc.
  30.  
  31. NitPick:  The Gregorian calendar is what we use now.  The Julian
  32. calendar is what was switched from.  1752 is correct for Britain
  33. and its then-colonies (Protestant countries changed at different
  34. times in the 16/1700s).  The Catholic countries had changed over 
  35. a century and a half earlier (1582).  Some places didn't change 
  36. until a century and a half later.
  37.  
  38. Gary Ansok
  39. ansok@alumni.caltech.edu
  40.